const shell = require('shelljs');
const { dateFormat, DATE_FORMAT_TM } = require('@zhupengji/js-utils')

if (!shell.which('git')) {
    shell.echo('Sorry, this script requires git');
    shell.exit(1);
}

const msg = 'chore(release): [' + dateFormat(new Date(), DATE_FORMAT_TM) + ']'

shell.exec('pnpm run docs:build');
shell.exec('git add .');
shell.exec(`git commit -m "${msg}"`);
shell.exec('git push');